﻿using System;
using UnityEngine;
using UnityEngine.UI;

public class Item : MonoBehaviour
{
    public Button btn;
    public Text text;
    
    private int id;
    private Action<int> callback;
    
    private void Start()
    {
        btn.onClick.AddListener(() =>
        {
            callback(id);
        });
    }

    public void Refresh(int id, Action<int> callback)
    {
        this.id = id;
        this.callback = callback;
    }
}